package com.softtek.ibeacon.dao;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.log4j.Logger;
import org.logicalcobwebs.proxool.ConnectionListenerIF;

public class SqlListener implements ConnectionListenerIF {

 

	final Logger log2 = Logger.getLogger(SqlListener.class); 

 

	public void onFail(String sql, Exception e) {

		System.out.println(sql + ":" + e.getMessage());
	}

	/**
	 * 执行sql语句时，超过指定毫秒数即记录下来。
	 * 
	 * @param sql
	 *            SQL语句
	 * @param elapsedTime
	 *            执行时间（毫秒）
	 * @return 中间库信息
	 */
	public void onExecute(String sql, long elapsedTime) { 
		log2.info(sql );
	}

	public void onDeath(Connection connection, int arg1) throws SQLException {
	}

	public void onBirth(Connection connection) throws SQLException {
	}
}